import request from "../../../utils/request";

class Banner {
  // static delAll=()=>request.get('/banner/removeAll')
  // static del=(bannerid)=>request.get('/banner/delete',{params:{bannerid}})
  // static add=(data)=>request.post('/banner/add',data)
  // static bannerList=()=>request.get('/banner/list')
  // static update=(data)=>request.post('/banner/updateFlag',data)
  static getNav=()=>request.get('/nav')
  static addnav =async (data)=> {
    let res = await request.post("/nav",data)
    console.log(res); 
    return {data:[{message:"添加成功",data:res.data,code:200}]}
  }
  // static getNav=()=>request.post('/nav')
  static delNav=async(id)=>{
    let res = await request.delete('/nav/'+id)
    return {data:[{message:'删除成功',code:200}]}
  }
  static changeNav=async(obj)=>{
    console.log(obj.id,obj.data);
    let res = await request.patch('/nav/'+obj.id,obj.data)
    console.log(res);
    return {data:[{message:'修改成功',code:200}]}
  }
  static Cflag=async(obj)=>{
    console.log(obj.id,obj.flag);
    let res = await request.patch('/nav/'+obj.id,{flag:!obj.flag})
    console.log(res);
    return {data:[{message:'修改成功',code:200}]}

  }
}
export default Banner